# $Id$
# Maintainer: Mr.chen <zggzcgy@gmail.com>

pkgname=dwm
pkgver=6.2
pkgrel=1
pkgdesc="A dynamic window manager for X"
url="http://dwm.suckless.org"
arch=('i686' 'x86_64')
license=('MIT')
options=(zipman)
optdepends=(
  'pamixer: volume key control support'
  'xorg-xbacklight: screen backlight key support')
depends=('libx11' 'libxinerama' 'libxft' 'freetype2' 'xterm' 'dmenu')
install=dwm.install
source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
    http://dl.suckless.org/dwm/dwm-xrdb-$pkgver.diff
    dwm-config-$pkgver.diff
    dwm.service
    dwm.desktop)
sha256sums=('97902e2e007aaeaa3c6e3bed1f81785b817b7413947f1db1d3b62b8da4cd110e'
            '6d3d63eab245ec39cee8986c7b6260577f2f77d5a3b98b85c11b2f3f2da92f40'
            '1c2f54c4ac5669a933aed92555ac38c7bcdb4f7405efe78d22158552f7ce4c58'
            '3936ba6a4dcb524fa11cbd357ab601db078ddf864a5e0a9f2915c6477ed5cfa2'
            'bc36426772e1471d6dd8c8aed91f288e16949e3463a9933fee6390ee0ccd3f81')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  patch -p1 < "$srcdir/$pkgname-xrdb-$pkgver.diff"
  test -f config.h || cp config.def.h config.h
  patch -p1 < "$srcdir/$pkgname-config-$pkgver.diff"
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11 FREETYPEINC=/usr/include/freetype2
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make PREFIX=/usr DESTDIR="$pkgdir" install
  install -m644 -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -m644 -D README "$pkgdir/usr/share/doc/$pkgname/README"
  install -m644 -D "$srcdir/dwm.service" "$pkgdir/usr/share/doc/$pkgname/dwm.service"
  install -m644 -D "$srcdir/dwm.desktop" "$pkgdir/usr/share/xsessions/dwm.desktop"
}

# vim:set ts=2 sw=2 et;
